#!/bin/ksh

#
# The point of the script is to simply prevent the case where
# the clock on the HMC may be initially set into the future,
# and this could jepordize the backup of critical HMC data. 
#
# When the user's sets the date/time via either HMC GUI, this
# routine will be called. It will be valid for one time only
# since the comparison file created by the 'finalizeImage'
# script will be erased at the end of this processing.
#
DAT_FILE=/opt/hsc/com/ibm/hsc/websm/launch/hscmgt/hscbuild.dat
CURRENT_TIME=/tmp/new_time

if [ -f /opt/hsc/data/.time_not_set ]; then
    touch $CURRENT_TIME
    if [ $DAT_FILE -nt $CURRENT_TIME ]; then
        touch $DAT_FILE
    fi
    rm $CURRENT_TIME

    rm -f /opt/hsc/data/.time_not_set
fi
exit 0
